Add edit dialog for managed agents with relay profile sync#277
Add edit dialog for managed agents with relay profile sync#277wpfleger96 merged 4 commits intomainfrom
Conversation
13dd89e to
370ea44
Compare
|
@wpfleger96 I have some agent catalog stuff in flight here, so it might change the behavior of this. Let's check things again after that merges to see where we can improve. |
|
@wesbillman np happy to wait until that's ready! |
|
@wpfleger96 excellent, the start of the catalog is in there now so feel free to take a look. Might not impact this work too much. Oh also, it's nice if you can drop an image or 2 in here (or a video) to see what this feature does for the reviewers |
a64f253 to
afaed41
Compare
|
@wpfleger96 is the #288 work similar to yours here? |
Think they are adjacent, but not overlapping. #288 is mostly for importing against "my" teams and agents. |
e6c391c to
bd01f8f
Compare
a365ffa to
1fae620
Compare
|
@wesbillman mind giving this another look if you get the chance? 😄 |
Once a managed agent was created, there was no way to change its configuration — system prompt, parallelism, relay URL, commands, timeouts, and name — without deleting and recreating it from scratch. Extends UpdateManagedAgentRequest on the Rust side to accept all editable fields with patch semantics (absent = don't touch), updates the update_managed_agent command handler to apply them, and mirrors the extended type on the frontend. Adds a useUpdateManagedAgentMutation hook following the existing mutation pattern, creates EditAgentDialog that reuses the CreateAgentDialogSections form components pre-populated with the agent's current values, and wires an "Edit" item into the AgentActionsMenu dropdown.
useEffect deps included non-stable references (agent object, args array), causing form state to reset on every 5s background poll while the user was editing. Pin deps to [open, agent.pubkey]. Also: validate numeric fields in canSubmit, trim relayUrl before diff, hide Edit for provider-backed agents, and block empty acpCommand/mcpCommand submission.
update_managed_agent was fire-and-forget for name changes — the local record updated but the relay's kind:0 profile event was never re-published, making renames invisible in @mentions, DMs, and member lists. Reuses the existing sync_managed_agent_profile() path from agent creation to re-publish the kind:0 event when the name changes.
1fae620 to
77fec21
Compare
|
@codex review please |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 77fec21304
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@wpfleger96 I think we can probably merge this thing now if you're good with it |
|
@wesbillman thank you! I'll address those Codex review comments rq then merge |
…, e2e bridge
Three issues caught by Codex bot review:
1. UpdateManagedAgentResponse had #[serde(rename_all = "camelCase")] but
CreateManagedAgentResponse does not — frontend read profile_sync_error
(snake_case) which was always undefined since the wire format was camelCase.
Removed the rename attribute to match the existing pattern.
2. update_managed_agent persisted blank relay URLs as empty strings instead
of falling back to relay_ws_url() like create_managed_agent does. Would
break SPROUT_RELAY_URL on next agent spawn.
3. e2e bridge's handleUpdateManagedAgent returned a raw RawManagedAgent
instead of the wrapped { agent, profile_sync_error } shape, causing
fromRawManagedAgent(undefined) in test mode.
|
Awesome! Thanks for doing this @wpfleger96! |






This PR adds an Edit dialog for managed agents so configuration changes don't require delete-and-recreate, and syncs name changes to the relay so they're visible in @mentions, DMs, and member lists.
UpdateManagedAgentRequestonly patchedmodelandsystem_prompt. Name, parallelism, relay URL, agent command, MCP command, turn timeout, and toolsets were write-once at creation time. Renaming an agent updated the local record but never re-published the relay profile, making name changes invisible to other users.UpdateManagedAgentRequestintypes.rswith editable fields for all runtime config (parallelism, relay URL, commands, toolsets) using patch semanticsupdate_managed_agentasync; callsync_managed_agent_profile()to re-publish the kind:0 event when the name changes (best-effort — local save always succeeds, relay sync failure is logged and returned as a non-fatal warning)useUpdateManagedAgentMutationhook with optimistic cache update and invalidation onmanaged-agentsandrelay-agentsqueriesEditAgentDialog.tsxreusingCreateAgentBasicsFieldsandCreateAgentRuntimeFieldspre-populated with current values; diffs on submit to send only changed fields; includesmcpToolsetsfield from Add per-agent MCP toolset configuration to agent setup #279DropdownMenuItemwith aPencilicon intoAgentActionsMenuinManagedAgentRow.tsx(hidden for provider-backed agents)parallelism,turnTimeoutSeconds) and block clearing previously-setacpCommand/mcpCommandto empty strings